package xin.yangshuai.basic01.generic;

import java.lang.reflect.TypeVariable;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.TreeSet;

class EraseTest{
    public static void test1(){
        Class c1=new LinkedList<String>().getClass();
        Class c2=new LinkedList<Integer>().getClass();
        System.out.println(c1==c2);
    }

    public static void test2(){
        TypeVariable[] variables=new HashMap<String,Integer>().getClass().getTypeParameters();
        System.out.println(Arrays.toString(variables));

        variables=new TreeSet<String>().getClass().getTypeParameters();
        System.out.println(Arrays.toString(variables));
    }

    public static void main(String[] args) {
        test1();
        test2();
    }
}
//output:
//true
//[K, V]
//[E]
